<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="dist/css/swiper.min.css">
    <style>
        html, body {
            position: relative;
            height: 100%;
        }
        body {
            background: #eee;
            font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
            font-size: 14px;
            color:#000;
            margin: 0;
            padding: 0;
        }
        .swiper-container {
            width: 100%;
            height: 100%;
            
        }
        .swiper-slide {
            text-align: center;
            font-size: 18px;
            background: rgb(17, 16, 16);
            
            /* Center slide text vertically */
            display: -webkit-box;
            display: -ms-flexbox;
            display: -webkit-flex;
            display: flex;
            -webkit-box-pack: center;
            -ms-flex-pack: center;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-box-align: center;
            -ms-flex-align: center;
            -webkit-align-items: center;
            align-items: center;
        }
        </style>
</head>
<body>
    <div id="app" class="swiper-container">
        <div class="swiper-wrapper">
            <img :src="imgArr[index]" alt="" class="swiper-slide">
        </div>
        <!-- <input v-show="index>0" type="button" value="上一张" @click="prev">
        <img :src="imgArr[index]" alt="">
        <input v-show="index<2" type="button" value="下一张" @click="next"> -->
        <div class="swiper-button-prev" v-show="index>0" @click="prev"></div>
        <div class="swiper-button-next" v-show="index<2" @click="next"></div>
    </div>
    <!-- vue开发环境版本，包含了有帮助的命令行警告(相当于导入包) -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el:"#app",
            data:{
                imgArr:["http://shp.qpic.cn/ishow/2735082412/1629781145_84828260_9972_sProdImgNo_2.jpg/0",
                        "http://shp.qpic.cn/ishow/2735081114/1628662773_84828260_7450_sProdImgNo_2.jpg/0",
                        "http://shp.qpic.cn/ishow/2735080511/1628133282_84828260_9817_sProdImgNo_6.jpg/0"],
                index:0,
            },
            methods:{
               next:function(){
                    this.index++
               },
               prev:function(){
                    this.index--
               }

            },
        })
    </script>
     <script>
        var swiper = new Swiper('.swiper-container', {
            pagination: '.swiper-pagination',
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',
            paginationClickable: true,
            spaceBetween: 30,
            centeredSlides: true,
            autoplay: 2500,
            autoplayDisableOnInteraction: false
        });
        </script>
    <script src="dist/js/swiper.min.js"></script>
</body>
</html>